-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DUBBO-3746] Bugfix: infinite loop in AbstractRegistry when IOException. fix #3746 #3748
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3748 +/- ##
============================================
+ Coverage 63.55% 63.61% +0.05%
Complexity 71 71
============================================
Files 704 704
Lines 31069 31070 +1
Branches 5037 5038 +1
============================================
+ Hits 19746 19765 +19
+ Misses 9050 9034 -16
+ Partials 2273 2271 -2
Continue to review full report at Codecov.
|
...try/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
Outdated
Show resolved
Hide resolved
What if other type of exception other than IOException is thrown, this might introduce the same issue. I think a safer way is to limit the number of time to retry. |
@ralf0131 how many times to retry? I think 3 is enough, what's your opinion? |
3 looks good to me. |
...try/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me. I'd waiting for @carryxyh 's comments.
Ping @carryxyh , what's your opinion on this pull request? |
Sorry for coming late. @kezhenxu94 @ralf0131 I have no more comments on this pr. After my test, multiple threads read and write to the same file will not generate exceptions and will not be out of order. But we still have to consider some other special circumstances that cause the write to fail. I think we can merge this pr first, I will conduct further testing and submit an extra pr if I think we need to optimize it. |
@kezhenxu94 |
What is the purpose of the change
resolve #3746
When
IOException
is thrown inorg.apache.dubbo.registry.support.AbstractRegistry#doSaveProperties
, which is usually unrecoverable (permission denied, path not exists or no free disk space) it will retry infinitely, this patch tries to resolve this issue by stop retrying whenIOException
occurs.Brief changelog
org.apache.dubbo.registry.support.AbstractRegistry
Verifying this change
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.